<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@page import="com.yaodian100.crm.workflow.entity.WorkFlowNode" %>
<%@taglib uri="/WEB-INF/tld/pageutil.tld" prefix="pu"%>
<%@taglib uri="/WEB-INF/tld/pageable.tld" prefix="pageable"%>
<%@taglib uri="http://java.sun.com/jstl/core" prefix="c"%>
<%@taglib uri="http://java.sun.com/jstl/core_rt" prefix="c-rt"%>
<%@taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt-rt"%>
<c-rt:if test="${!empty param.cqtId}">
	<c-rt:set var="cqtId" value="${param.cqtId }"/>
</c-rt:if>
<c-rt:if test="${empty param.cqtId}">
	<c-rt:set var="cqtId" value="${cqt.id }"/>
</c-rt:if>
<script>
var content;
</script>
<c-rt:set var="tp" value="${pu:pageableTag('tpp', 5, 10)}"/>
${pu:criteriaForName('com.yaodian100.crm.cs.entity.MustInquire') }
${pu:criteriaAdd(pu:criteria('eq', 'commonQuestionType.id', cqtId)) }
${pu:criteriaAddOrder(pu:criteriaOrderDesc('createDate')) }
<c-rt:set var="mis" value="${pu:criteriaResult(tp)}"/>
<table class="tb-data" width="100%">
<thead>
<tr>
<th><input type="button" value="新增必问问题" onclick="doAR('<%=application.getContextPath() %>/cs/mustInquire/page.do?iamlazy=updateMustInquire&commonQuestionTypeId=${cqtId }','dialog');openDialog()"/></th>
<th>id</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<c-rt:forEach items="${mis}" var="mi">
<tr>
<td>
<input type="button" value="删除" onclick="if(confirm('確定刪除？'))doAR('<%=application.getContextPath()%>/cs/mustInquire/deleteMustInquire.do?id=${mi.id}&cqtId=${cqtId }', 'miList')"/>
<input type="button" value="编辑" onclick="doAR('<%=application.getContextPath() %>/cs/mustInquire/page.do?iamlazy=updateMustInquire&id=${mi.id }&commonQuestionTypeId=${cqtId }','dialog');openDialog()"/>
<input type="button" value="回答清單" onclick="doAR('<%=application.getContextPath()%>/cs/mustInquire/page.do?iamlazy=listAnswer&miId=${mi.id }', 'dialog');openDialog('回答清單',content, 400,300)"/>
</td>
<td>${mi.id }</td>
<td>${mi.description }</td>
</tr>
</c-rt:forEach>
</tbody>
</table>
<c-rt:set var="url">
<%=application.getContextPath() %>/cs/mustInquire/page.do
</c-rt:set>
<pageable:Pageable url="${url}" formname="miForm" escapeparams="AJAX,refreshZone,iamlazy" parameter="iamlazy=list&AJAX=true&refreshZone=miList&cqtId=${cqtId}" key="tpp"></pageable:Pageable>